//package com.example.sale.config;
//
//import org.springframework.amqp.core.Binding;
//import org.springframework.amqp.core.BindingBuilder;
//import org.springframework.amqp.core.DirectExchange;
//import org.springframework.amqp.core.Queue;
//import org.springframework.context.annotation.Bean;
//
//public class DirectConfiguration {
//    @Bean
//    public DirectExchange directExchange(){
//        //ExchangeBuilder.fanoutExchange("").build();
//        return  new DirectExchange("hmall.direct");
//    }
//    //声明队列
//    @Bean
//    public Queue directQueue1(){
//        //QueueBuilder.durable("ff").build();
//        return new Queue("direct.queue1");
//    }
//    @Bean
//    public Queue directQueue2(){
//        //QueueBuilder.durable("ff").build();
//        return new Queue("direct.queue2");
//    }
//    //绑定
//    @Bean
//    public Binding DirectBinding1(Queue directQueue1, DirectExchange directExchange){
//        return BindingBuilder.bind(directQueue1).to(directExchange).with("red");
//    }
//    @Bean
//    public Binding DirectBinding2(Queue directQueue1,DirectExchange directExchange){
//        return BindingBuilder.bind(directQueue1).to(directExchange).with("blue");
//    }
//    @Bean
//    public Binding DirectBinding3(Queue directQueue2,DirectExchange directExchange){
//        return BindingBuilder.bind(directQueue2).to(directExchange).with("red");
//    }
//    @Bean
//    public Binding DirectBinding4(Queue directQueue2,DirectExchange directExchange){
//        return BindingBuilder.bind(directQueue2).to(directExchange).with("yellow");
//    }
//}
